from django.urls import path, re_path
from django.views.static import serve

from back_end import settings
from . import product_views, trace_product_views

urlpatterns = [
    path("search/", product_views.search),
    path('check/cookie/', product_views.check_cookies),
    path('check/qrcode/', product_views.get_qr_code),
    path('check/loginstatus/', product_views.check_login_status),
    path('check/close/', product_views.close_webdriver),
    path("trace/add/", trace_product_views.add_trace_product),
    path("trace/get/", trace_product_views.get_trace_product),
    path("trace/modify/", trace_product_views.modify_trace_product),
    path("trace/delete/", trace_product_views.delete_trace_product),
    path("trace/inspect/", trace_product_views.inspect_trace_products),
    path("trace/email/", trace_product_views.check_user_trace),
    path("history/", trace_product_views.get_history_price),
    re_path(r'^image/qrcode(?P<path>.*)$', serve, {'document_root': settings.USER_AVATAR_ROOT}),
]